This page provides an overview of ‘how-to’ incorporate connectivity into Marxan (I. R. Ball, Possingham, and Watts 2009), some instructions for using Marxan Connect combined with example of workflows using both demographic and landscape connectivity data.
The maps and plots shown in this tutorial were created in R using the shapefile exported from the “Plotting Options” tab of Marxan Connect. The R code used to make the plots can be revealed by clicking on the Code button below
library(sf)
library(leaflet)
library(tmap)
library(tidyverse)
# set default projection for leaflet
proj <- "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"
(D’Aloia et al. 2017)
(Beger et al. 2010)
The following section provides examples of possible workflows. It is important to note that these are indeed examples of the software’s capabilities and are not intended to be used as scientific advice in a spatial conservation planning process. It is the user’s responsibility to ensure that all analysis decisions are valid.
Let’s see all the input layers:
# planning units
pu <- st_read('data/GBR_demographic_gridded_example/hex_planning_units.shp') %>%
st_transform(proj)
# focus areas (IUCN level I or II protected areas)
fa <- st_read('data/GBR_demographic_gridded_example/IUCN_IorII.shp') %>%
st_transform(proj)
# avoidance areas (ports)
aa <- st_read('data/GBR_demographic_gridded_example/ports.shp') %>%
st_transform(proj)
p <- qtm(pu,fill = '#7570b3') +
qtm(fa,fill = '#1b9e77') +
qtm(aa,fill = '#d95f02')
tmap_leaflet(p) %>%
addLegend(position = "topright",
labels = c("Planning Units","Focus Areas (IUCN I or II)","Avoidance Areas (ports)"),
colors = c("#7570b3","#1b9e77","#d95f02"),
title = "Layers")
library(RColorBrewer)
YlOrRd <- colorRamp(brewer.pal(9,"YlOrRd"))
YlOrRd(1)
## [,1] [,2] [,3]
## [1,] 128 0 38
then the output:
# planning units with output
output <- read.csv('data/GBR_demographic_gridded_example/output/pu.csv') %>%
mutate(geometry=st_as_sfc(geometry,"+proj=longlat +datum=WGS84"),
best_solution = as.logical(best_solution),
fa_included = as.logical(gsub("True",TRUE,.$fa_included)),
aa_included = as.logical(gsub("True",TRUE,.$aa_included)),
status = as.character(status)) %>%
st_as_sf()
# names(output)
map <- leaflet(output) %>%
addTiles()
groups <- names(output)[c(-1,-2,-length(names(output)))]
for(i in groups){
print(i)
z <- unlist(data.frame(output)[i])
if(is.numeric(z)){
pal <- colorBin("YlOrRd", domain = z)
}else{
pal <- colorFactor("YlOrRd", domain = z)
}
map = map %>%
addPolygons(fillColor = ~pal(z),
fillOpacity = 0.6,
weight=0.5,
color="white",
group=i,
label = as.character(z)) %>%
addLegend(pal = pal,
values = z,
title = i,
group = i,
position="bottomleft")
}
## [1] "fa_included"
## [1] "aa_included"
## [1] "aa_donors_demo_pu"
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## [1] "aa_recipients_demo_pu"
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## [1] "between_cent_demo_pu"
## [1] "eig_vect_cent_demo_pu"
## [1] "fa_donors_demo_pu"
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## [1] "fa_recipients_demo_pu"
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## [1] "google_demo_pu"
## [1] "in_degree_demo_pu"
## [1] "out_degree_demo_pu"
## [1] "self_recruit_demo_pu"
## [1] "best_solution"
## [1] "select_freq"
## [1] "status"
map <- map %>%
addLayersControl(overlayGroups = groups,
options = layersControlOptions(collapsed = FALSE))
for(i in groups){
map <- map %>% hideGroup(i)
}
map %>%
showGroup("select_freq")
habitats <- st_read('data/shapefiles/habitat.shp') %>%
st_transform(proj)
p <- tm_shape(habitats) +
tm_fill("habitat",title="Habitat Type")
tmap_leaflet(p)
Ball, Ian R, Hugh P Possingham, and M Watts. 2009. “Marxan and Relatives: Software for Spatial Conservation Prioritisation.” Spatial Conservation Prioritisation: Quantitative Methods and Computational Tools. Oxford University Press, Oxford, 185–95.
Beger, Maria, Simon Linke, Matt Watts, Eddie Game, Eric Treml, Ian Ball, and Hugh P Possingham. 2010. “Incorporating Asymmetric Connectivity into Spatial Decision Making for Conservation.” Conservation Letters 3 (5). Blackwell Publishing Inc: 359–68.
D’Aloia, Cassidy C, Rémi M Daigle, Isabelle M Côté, Janelle M R Curtis, Frédéric Guichard, and Marie-Josée Fortin. 2017. “A Multiple-Species Framework for Integrating Movement Processes Across Life Stages into the Design of Marine Protected Areas.” Biol. Conserv. 216 (December): 93–100.